#include <TGS/MapControl2.0/MapToolBar.h>
#include <TGS/MapControl2.0/MapActions.h>

namespace TGS{
namespace MapControl{


MapToolBar::MapToolBar(MapActions* mapActions, QWidget* parent /* = nullptr */)
	: QToolBar(parent)
	, _mapActions(mapActions)
{
	initialize();
}


MapToolBar::~MapToolBar(void)
{
}

MapActions* MapToolBar::getMapActions()
{
	return _mapActions;
}

void MapToolBar::initialize()
{
	this->addAction(_mapActions->getActionPan());
	this->addAction(_mapActions->getActionZoomIn());
	this->addAction(_mapActions->getActionZoomOut());
	this->addAction(_mapActions->getActionZoomFullExtent());
	this->addAction(_mapActions->getActionSelectPoint());
	this->addAction(_mapActions->getActionSelectPolygon());
	this->addAction(_mapActions->getActionSelectRectangle());
	this->addAction(_mapActions->getActionDeselectAll());
	this->addAction(_mapActions->getActionIdentify());
	this->addAction(_mapActions->getActionMearureArea());
	this->addAction(_mapActions->getActionDrawPolygon());
}

inline QAction* MapToolBar::getActionPan()
{
	return _mapActions->getActionPan();
}

inline QAction* MapToolBar::getActionZoomIn()
{
	return _mapActions->getActionZoomIn();
}

inline QAction* MapToolBar::getActionZoomOut()
{
	return _mapActions->getActionZoomOut();
}

inline QAction* MapToolBar::getActionIdentify()
{
	return _mapActions->getActionIdentify();
}

inline QAction* MapToolBar::getActionSelectPolygon()
{
	return _mapActions->getActionSelectPolygon();
}

inline QAction* MapToolBar::getActionZoomFullExtent()
{
	return _mapActions->getActionZoomFullExtent();
}

inline QAction* MapToolBar::getActionSelectRectangle()
{
	return _mapActions->getActionSelectRectangle();
}

inline QAction* MapToolBar::getActionDeselectAll()
{
	return _mapActions->getActionDeselectAll();
}

QAction* MapToolBar::getActionSelectPoint()
{
	return _mapActions->getActionSelectPoint();
}

QAction* MapToolBar::getActionMearureArea()
{
	return _mapActions->getActionMearureArea();
}

QAction* MapToolBar::getActionDrawPolygon()
{
	return _mapActions->getActionDrawPolygon();
}

}//MapControl
}//TGS